3.377 \(\int (a+b \tan ^3(c+d x)) \, dx\)

Optimal. Leaf size=32 \[ a x+\frac {b \tan ^2(c+d x)}{2 d}+\frac {b \log (\cos (c+d x))}{d} \]

[Out]

a*x+b*ln(cos(d*x+c))/d+1/2*b*tan(d*x+c)^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3473, 3475} \[ a x+\frac {b \tan ^2(c+d x)}{2 d}+\frac {b \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[a + b*Tan[c + d*x]^3,x]

[Out]

a*x + (b*Log[Cos[c + d*x]])/d + (b*Tan[c + d*x]^2)/(2*d)

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \left (a+b \tan ^3(c+d x)\right ) \, dx &=a x+b \int \tan ^3(c+d x) \, dx\\ &=a x+\frac {b \tan ^2(c+d x)}{2 d}-b \int \tan (c+d x) \, dx\\ &=a x+\frac {b \log (\cos (c+d x))}{d}+\frac {b \tan ^2(c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 30, normalized size = 0.94 \[ a x+\frac {b \left (\tan ^2(c+d x)+2 \log (\cos (c+d x))\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Tan[c + d*x]^3,x]

[Out]

a*x + (b*(2*Log[Cos[c + d*x]] + Tan[c + d*x]^2))/(2*d)

________________________________________________________________________________________

fricas [A]  time = 0.53, size = 36, normalized size = 1.12 \[ \frac {2 \, a d x + b \tan \left (d x + c\right )^{2} + b \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)^3,x, algorithm="fricas")

[Out]

1/2*(2*a*d*x + b*tan(d*x + c)^2 + b*log(1/(tan(d*x + c)^2 + 1)))/d

________________________________________________________________________________________

giac [B]  time = 1.62, size = 251, normalized size = 7.84 \[ a x + \frac {{\left (\log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} \tan \relax (c)^{2} - 2 \, \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) \tan \left (d x\right ) \tan \relax (c) + \tan \left (d x\right )^{2} + \tan \relax (c)^{2} + \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{4} \tan \relax (c)^{2} - 2 \, \tan \left (d x\right )^{3} \tan \relax (c) + \tan \left (d x\right )^{2} \tan \relax (c)^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \relax (c) + 1\right )}}{\tan \relax (c)^{2} + 1}\right ) + 1\right )} b}{2 \, {\left (d \tan \left (d x\right )^{2} \tan \relax (c)^{2} - 2 \, d \tan \left (d x\right ) \tan \relax (c) + d\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)^3,x, algorithm="giac")

[Out]

a*x + 1/2*(log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*ta
n(c) + 1)/(tan(c)^2 + 1))*tan(d*x)^2*tan(c)^2 + tan(d*x)^2*tan(c)^2 - 2*log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x
)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(d*x)*tan(c) + tan(d
*x)^2 + tan(c)^2 + log(4*(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan
(d*x)*tan(c) + 1)/(tan(c)^2 + 1)) + 1)*b/(d*tan(d*x)^2*tan(c)^2 - 2*d*tan(d*x)*tan(c) + d)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 36, normalized size = 1.12 \[ a x +\frac {b \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*tan(d*x+c)^3,x)

[Out]

a*x+1/2*b*tan(d*x+c)^2/d-1/2/d*b*ln(1+tan(d*x+c)^2)

________________________________________________________________________________________

maxima [A]  time = 0.30, size = 36, normalized size = 1.12 \[ a x - \frac {b {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)^3,x, algorithm="maxima")

[Out]

a*x - 1/2*b*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1))/d

________________________________________________________________________________________

mupad [B]  time = 11.53, size = 34, normalized size = 1.06 \[ \frac {\frac {b\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2}-\frac {b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2}+a\,d\,x}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a + b*tan(c + d*x)^3,x)

[Out]

((b*tan(c + d*x)^2)/2 - (b*log(tan(c + d*x)^2 + 1))/2 + a*d*x)/d

________________________________________________________________________________________

sympy [A]  time = 0.18, size = 37, normalized size = 1.16 \[ a x + b \left (\begin {cases} - \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {\tan ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \tan ^{3}{\relax (c )} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(d*x+c)**3,x)

[Out]

a*x + b*Piecewise((-log(tan(c + d*x)**2 + 1)/(2*d) + tan(c + d*x)**2/(2*d), Ne(d, 0)), (x*tan(c)**3, True))

________________________________________________________________________________________